package com.guigu.simplefactory;

/**
 * @description:
 * @author: lizhenhua05
 * @created: 2021/01/24 14:26
 */
public class SimpleFactory {

    public static Pizza getPizza(int i){
        Pizza pizza = null;
        if (i==1){
            pizza = new ChinesePizza();
            pizza.make();
            pizza.cut();
            pizza.box();
        }else if (i==2){
            pizza = new AmericanPizza();
            pizza.make();
            pizza.cut();
            pizza.box();
        }
        return pizza;
    }
}
